package net.towee.model.repo;

/**
 * Factory of attachments.
 * @author c58
 */
public interface AttachmentFactory {
	/**
	 * This factory method create attachment which will stored in
	 * DB(GridFS) file with given id.
	 * 
	 * Implementation try to cast given file to picture, torrent or
	 * video and create same Attachment implementation(e.g. AttachmentPicture
	 * for picture).
	 * 
	 * For torrent file it register it in tracker.
	 * 
	 * If file didn't casted to known types, it create AttachmentGeneral.
	 * 
	 * @param id
	 * @return Attachment implementation or null if file with given id not found
	 */
	 AttachmentInfo createAttachment(String id);
}
